/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.jfonia.actions;

import java.awt.event.ActionEvent;
import org.jfonia.images.ImageConstants;
import org.jfonia.images.ScaledImageIcon;
import org.jfonia.language.DescriptionConstants;
import org.jfonia.language.LabelConstants;
import org.jfonia.language.LanguageResource;
import org.jfonia.view.main.LeadSheetPlayer;

/**
 *
 * @author Rik Bauwens
 */
public class StopAction extends PlayerAction
{
        protected StopAction(int iconMaxSize)
        {
                super(LanguageResource.getInstance().getLabel(LabelConstants.STOP),
                      new ScaledImageIcon(ImageConstants.STOP,
                      LanguageResource.getInstance().getDescription(DescriptionConstants.STOP))
                      .setMaximumSide(iconMaxSize).getImageIcon());
        }

        public void actionPerformed(ActionEvent e)
        {
                ((PlayOrPauseAction) ActionFactory.getInstance().getAction(ActionFactory.PLAYORPAUSEACTION)).setPlay();
                LeadSheetPlayer.getInstance().stop();
        }
}
